function [Dpi] = Dwelfare_Dq(q_ij,beta,delta,s_i,cobb_par,E,M,r,K_obs,c_inv,W_k,U_k,J_k,sigma,sf)
%UNTITLED Summary of this function goes here
%   Detailed explanation goes here
p_ij = prices(q_ij,beta,delta,s_i,cobb_par,E,M,r,K_obs,c_inv,sf);

%--------------- derivative profits

Dpi = zeros(M,M);
for i = 1:M
    for j= 1:M
        if i~=j
            Dpi(i,j) = p_ij(i,j) + (W_k(i,j) - J_k(i))./sigma;
        end
    end
end


end

